package com.qyhl.shop.shop.showcase;

import com.qyhl.webtv.commonlib.entity.shop.ShopShowcaseBean;
import com.qyhl.webtv.commonlib.entity.shop.ShopShowcaseNoticeBean;

import java.util.List;

public class ShopShowcaseListPresenter implements ShopShowcaseListContract.ShopShowcaseListPresenter {
    private ShopShowcaseListContract.ShopShowcaseListView mView;
    private ShopShowcaseListModel mModel;

    public ShopShowcaseListPresenter(ShopShowcaseListContract.ShopShowcaseListView mView) {
        this.mView = mView;
        this.mModel = new ShopShowcaseListModel(this);
    }

    @Override
    public void getList(int shopId, int page) {
        mModel.getList(shopId, page);
    }

    @Override
    public void getNotice(int shopId) {
        mModel.getNotice(shopId);
    }

    @Override
    public void setList(List<ShopShowcaseBean> beanList) {
        if (beanList == null || beanList.size() < 1) {
            mView.setList(null);
        } else {
            mView.setList(beanList);
        }
    }

    @Override
    public void setNotice(ShopShowcaseNoticeBean bean) {
        mView.setNotice(bean);
    }

    @Override
    public void setError(String msg) {
        mView.setError(msg);
    }
}
